<%@ page import="com.nxcy.utils.DBUtil" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body> 
<%  
request.setCharacterEncoding("UTF-8");
String username=request.getParameter("username");   
String password=request.getParameter("password");
String sex=request.getParameter("sex");
    DBUtil db=new DBUtil();



if(username!=null&&username.startsWith("a")){
  if(password.length()>6)
  { 
  	if("1".equals(sex))
  	{
 	    request.setAttribute("welcome","管理员先生");
 	 }else{
  	   request.setAttribute("welcome","管理员小姐");
  	}   
   request.getRequestDispatcher("success.jsp").forward(request,response);
  }else{
    request.setAttribute("msg","用户密码错误，密码长度必须大于6");
	request.getRequestDispatcher("login.jsp").forward(request,response);
  }        
}
else{   
    request.setAttribute("msg","用户名错误，用户名必须以a开头");
	request.getRequestDispatcher("login.jsp").forward(request,response);
}
%>
  

</body>
</html>
